﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Storage.Streams;

namespace MyHelloWinDevice
{
    class VirtualDevices
    {
        private CDeviceManger m_Parent = null;

        public Boolean StartMonitor(CDeviceManger Parent)
        {
            m_Parent = Parent;
            DeviceWatcher_Added();
            return true;
        }

        public Boolean StopMonitor()
        {
            return false;
        }

        public Boolean GetKey(DeviceContext Driver, out IBuffer deviceKey, out IBuffer authKey)
        {
            deviceKey = null;
            authKey = null;

            return false;
        }

        private void DeviceWatcher_Added()
        {
            // 添加设备
            DeviceContext Context = new DeviceContext();
            Context.Type = DeviceType.Virtual;
            Context.DeviceID = "7DD474A8-1CBE-4A67-943C-7ABBD2C2DE78";
            Context.DeviceName = "MyHelloWinVirtualDevice";
            Context.IsConnected = true;
            m_Parent.AddEvent(Context);
            m_Parent.CompleteEvent(Context);
        }
    }
}
